home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 17 / AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso / Rexx / CooKooClock.rexx < prev    next >
OS/2 REXX Batch file  |  1997-11-08  |  1KB  |  40 lines

  1. /* CooKoo for Coca Puffs v1.1 
  2. ** This is a very simple script that uses Play16 to play a cookoo
  3. ** clock sample at a given amount of loops according to what hour it is.
  4. ** Please note the variable "hourprotect". This can be toggled on or off.
  5. ** Its purpose is to prevent this program from actually triggering the
  6. ** sample if it is NOT at the top of the hour. Its default is OFF.
  7. **
  8. ** 07-16-97 v1.1 Will now trigger with a single cookoo on the half hour
  9. ** provided that the 'hourprotect' variable is 'OFF'.
  10. */
  11.  
  12.  
  13.     play16path         = 'c:'
  14.     hourprotect     = OFF                    /* ON or OFF */
  15.     time            = left(time(), 5)        /* 22:00 */
  16.     hour             = left(time, 2)
  17.     minutes         = right(time, 2)
  18.  
  19.  
  20.     if (hourprotect = ON) & (minutes ~= 00) then exit
  21.  
  22.     if hour = 00 then hour = 12
  23.     if minutes = 30 then hour = 1
  24.     if (hour > 12) | (hour = 00) then do
  25.         if hour = 13 then hour = 1
  26.         if hour = 14 then hour = 2
  27.         if hour = 15 then hour = 3
  28.         if hour = 16 then hour = 4 
  29.         if hour = 17 then hour = 5
  30.         if hour = 18 then hour = 6
  31.         if hour = 19 then hour = 7
  32.         if hour = 20 then hour = 8
  33.         if hour = 21 then hour = 9
  34.         if hour = 22 then hour = 10
  35.         if hour = 23 then hour = 11
  36.     end
  37.     
  38.     address command 'run <>NIL:' play16path'play16 ezcron:sounds/CooKooClock L='hour
  39.     exit
  40.